/**
 * 
 */
package com.web.controller;

import java.io.File;

import javax.servlet.http.HttpServletResponse;



import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import com.alibaba.fastjson.JSONArray;


/**
 * @author leiruiqi
 *
 */
public class UploadController {

	@RequestMapping(value = "/award/importBill", method = RequestMethod.POST)
    public void doFileUpload(@RequestParam("myFile") MultipartFile mFile,HttpServletResponse response)
            throws Exception {
    	if (!mFile.isEmpty()) {
            String filePath = this.getClass().getClassLoader().getResource("").getPath();
            	//filePath = filePath.substring(0, filePath.indexOf("target"));
            File file = new File(filePath + "/" + mFile.getOriginalFilename());
            
            mFile.transferTo(file);
            
            
        }else{
        	//imgUploadResult.setResultCode("empty file");
        }
    	//this.returnJsonObject(response, imgUploadResult);
        return;
    }
}
